<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Template.Master" Inherits="IWS.SiteManager.Web.Views.LayoutView<IWS.SiteManager.Core.Model.SetupInformation>" %>

<asp:Content ID="Content2" ContentPlaceHolderID="HeadContent" runat="server">
<script type="text/javascript">
	$().ready(function() {
		$("#frmMain").submit(function() {

			//validate required

			//validate password confirm
			if ($("#AdminPass").val() != $("#AdminPassConfirm").val()) {
				alert("password confirm mismatch");
				return false;
			}

			return true;
		});

	});
</script>
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

 <h2>Setup Site</h2>
 
<%--	so my thought here is that the app unloads after the first submit, forcing it to reload its membership configuraiton; 
	which after the first post is now setup. 
	
	With membership conifg in place, we should be able to add users and roles to the database defined in step 1.--%>
 
 
 

	<p>This installation process will setup and configure a brand new database with default settings.</p>
<%	using (Html.BeginForm("Step2", "Install", FormMethod.Post, new { id="frmMain", name="frmMain"}))
	{ %>
	<%=Html.ValidationSummary()%>
	<div class="MessageBox">
	<%=ViewData["Exception"] != null ? HttpUtility.HtmlEncode(((Exception)ViewData["Exception"]).Message).Replace("\n","<br/>") : string.Empty%>
	</div>
	<h3>Site Settings</h3>
	<p>This is just a normal account with admin rights. I recommend against using "admin" as the username. </p>
	<table class="form">
		<tr>
			<th><label for="AdminUser">Admin Username:</label></th>
			<td><%=Html.TextBox("AdminUser", Model.AdminUser)%>
			<%=Html.ValidationMessage("AdminUser", "*")%></td>
		</tr>
		<tr>
			<th><label for="AdminPass">Admin Password:</label></th>
			<td><%=Html.Password("AdminPass", Model.AdminPass)%>
			<%=Html.ValidationMessage("AdminPass", "*")%></td>
		</tr>
		<tr>
			<th><label for="AdminPassConfirm">Confirm Password:</label></th>
			<td><%=Html.Password("AdminPassConfirm", Model.AdminPass)%></td>
		</tr>
		<tr>
			<th><label for="AdminEmail">Admin Email:</label></th>
			<td><%=Html.TextBox("AdminEmail", Model.AdminEmail)%>
			<%=Html.ValidationMessage("AdminPass", "*")%></td>
		</tr>
	</table>	
	
	<p><input type="submit" value="Finish" /></p>
<%	} %>	

</asp:Content>
